<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{$lang.home}{if $ur_here} - {$ur_here} {/if}</title>
<meta name="Copyright" content="Douco Design." />
<link href="templates/public.css" rel="stylesheet" type="text/css">
{include file="javascript.htm"}
<script type="text/javascript" src="images/laydate/laydate.js"></script>
<script type="text/javascript" src="images/layer/layer.js"></script>
</head>
<body>
<div id="dcWrap">
 {include file="header.htm"}
 <div id="dcLeft">{include file="menu.htm"}</div>
 <div id="dcMain">
   {include file="ur_here.htm"}
   <div id="coupon" class="mainBox" style="{$workspace.height}">
    <h3><a href="{$action_link.href}" class="actionBtn">{$action_link.text}</a><a href="coupon.php?rec=config" class="actionBtn">优惠券设置</a>
    <!-- <a href="coupon.php?rec=add" class="actionBtn add">生成优惠券</a> -->
    {$ur_here}</h3>
    
    <!-- {if $rec eq 'default'} 优惠券列表 -->
    <div class="filter">
      <form action="" method="post">
        <input name="user_id" class="inpMain" placeholder="用户ID" value="" size="20" type="text">
        <input name="submit" class="btnGray" value="查询" type="submit">
      </form>
    </div>
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
      <th width="30" align="center">{$lang.record_id}</th>
      <th align="center">{$lang.coupon_name}</th>
      <th align="center">{$lang.user_id}</th>
      <th align="center">{$lang.coupon_price}</th>
      <th align="center">{$lang.min_price}</th>
      <th align="center">{$lang.coupon_no}</th>
      <th align="center">{$lang.use_starttime}</th>
      <th align="center">{$lang.use_endtime}</th>
      <th align="center">{$lang.used_time}</th>
      <th align="center">{$lang.order_no}</th>
      <th align="center">{$lang.handler}</th>
     </tr>
     <!-- {foreach from=$coupon_list item=coupon} -->
     <tr>
      <td align="center">{$coupon.coupon_id}</td>
      <td align="center">{$coupon.coupon_name}</td>
      <td align="center">{$coupon.user_id}</td>
      <td align="center">{$coupon.coupon_price}</td>
      <td align="center">{$coupon.min_price}</td>
      <td align="center">{$coupon.coupon_no}</td>
      <td align="center">{$coupon.use_starttime}</td>
      <td align="center">{$coupon.use_endtime}</td>
      <td align="center">{$coupon.used_time}</td>
      <td align="center">{$coupon.order_no}</td>
      <td align="center"><a href="coupon.php?rec=del&coupon_id={$coupon.coupon_id}">{$lang.del}</a></td>
     </tr>
     <!-- {/foreach} -->
    </table>
    {include file="pager.htm"}
    <!-- {/if} -->

    <!-- {if $rec eq 'add'} 添加 -->
    <form action="coupon.php?rec=add" method="post">
     <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
      <tr>
       <td width="100" align="right">{$lang.coupon_name}</td>
       <td><input type="text" name="coupon_name" size="40" class="inpMain" /></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.coupon_price}</td>
       <td><input type="text" name="coupon_price" size="40" class="inpMain" /></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.min_price}</td>
       <td><input type="text" name="min_price" size="40" class="inpMain" /></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.use_starttime}</td>
       <td><input type="text" value="{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}" name="use_starttime" size="40" class="inpMain" {literal}onclick="laydate.skin('danlan');laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"{/literal} /></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.use_endtime}</td>
       <td><input type="text" name="use_endtime" size="40" class="inpMain" {literal}onclick="laydate.skin('danlan');laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"{/literal} /></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.for_user}</td>
       <td><input type="text" name="for_user" size="40" class="inpMain" /> {$lang.for_user_tip}</td>
      </tr>
      <tr>
       <td></td>
       <td>
        <input type="hidden" name="token" value="{$token}" />
        <input type="submit" name="submit" class="btn" value="{$lang.btn_submit}" />
       </td>
      </tr>
     </table>
    </form>
    <!-- {/if} -->


    <!-- {if $rec eq 'config'} 配置 -->
    <script type="text/javascript" src="images/jquery.tab.js"></script>
    <script type="text/javascript">
     {literal}
     $(function(){ $(".idTabs").idTabs(); });
     {/literal}
    </script>
    <form action="coupon.php?rec=config" method="post" enctype="multipart/form-data">
      <div class="idTabs">
      <ul class="tab">
        <li><a href="#tg">推广优惠券</a></li>
        <li><a href="#xhy">新会员优惠券</a></li>
        <li><a href="#dd">订单分享优惠券</a></li>
      </ul>

      <div id="tg">
        <table width="70%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
         <tr><th width="131">名称</th><th>内容</th></tr>
         <tr>
           <td align="right">优惠券名称</td>
           <td>
            <input type="text" name="coupon_tg[name]" value="{$coupon_tg.name}" placeholder="优惠券名称" size="20" class="inpMain" />
           </td>
          </tr>
         <tr>
           <td align="right">随机金额</td>
           <td>
            <input type="text" name="coupon_tg[min]" value="{$coupon_tg.min}" placeholder="最小金额" size="20" class="inpMain" />
            <input type="text" name="coupon_tg[max]" value="{$coupon_tg.max}" placeholder="最大金额" size="20" class="inpMain" /> <b>元</b>
           </td>
          </tr>
          <tr>
           <td align="right">张数</td>
           <td>
            <input type="text" name="coupon_tg[count]" value="{$coupon_tg.count}" placeholder="获得优惠券张数" size="20" class="inpMain" />
           </td>
          </tr>
          <tr>
           <td align="right">最小订单金额</td>
           <td>
            <input type="text" name="coupon_tg[min_price]" value="{$coupon_tg.min_price}" placeholder="最小订单金额" size="20" class="inpMain" />
           </td>
          </tr>
          <tr>
           <td align="right">结束时间</td>
           <td>
            <input type="text" name="coupon_tg[use_endtime]" value="{$coupon_tg.use_endtime}" placeholder="结束时间" size="20" class="inpMain" /> <b>天</b>
           </td>
          </tr>
        </table>
      </div>
      <div id="xhy">
        <table width="70%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
         <tr><th width="131">名称</th><th>内容</th></tr>
         <tr>
           <td align="right">优惠券名称</td>
           <td>
            <input type="text" name="coupon_xhy[name]" value="{$coupon_xhy.name}" placeholder="优惠券名称" size="20" class="inpMain" />
           </td>
          </tr>
         <tr>
           <td align="right">随机金额</td>
           <td>
            <input type="text" name="coupon_xhy[min]" value="{$coupon_xhy.min}" placeholder="最小金额" size="20" class="inpMain" />
            <input type="text" name="coupon_xhy[max]" value="{$coupon_xhy.max}" placeholder="最大金额" size="20" class="inpMain" /> <b>元</b>
           </td>
          </tr>
          <tr>
           <td align="right">张数</td>
           <td>
            <input type="text" name="coupon_xhy[count]" value="{$coupon_xhy.count}" placeholder="获得优惠券张数" size="20" class="inpMain" />
           </td>
          </tr>
          <tr>
           <td align="right">最小订单金额</td>
           <td>
            <input type="text" name="coupon_xhy[min_price]" value="{$coupon_xhy.min_price}" placeholder="最小订单金额" size="20" class="inpMain" />
           </td>
          </tr>
          <tr>
           <td align="right">结束时间</td>
           <td>
            <input type="text" name="coupon_xhy[use_endtime]" value="{$coupon_xhy.use_endtime}" placeholder="结束时间" size="20" class="inpMain" /> <b> 天</b>
           </td>
          </tr>
        </table>
      </div>
      <div id="dd">
        <table width="70%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
         <tr><th width="131">名称</th><th>内容</th></tr>
         <tr>
           <td align="right">优惠券名称</td>
           <td>
            <input type="text" name="coupon_dd[name]" value="{$coupon_dd.name}" placeholder="优惠券名称" size="20" class="inpMain" />
           </td>
          </tr>
         <tr>
           <td align="right">随机金额</td>
           <td>
            <input type="text" name="coupon_dd[min]" value="{$coupon_dd.min}" placeholder="最小金额" size="20" class="inpMain" />
            <input type="text" name="coupon_dd[max]" value="{$coupon_dd.max}" placeholder="最大金额" size="20" class="inpMain" /> <b>元</b>
           </td>
          </tr>
          <tr>
           <td align="right">张数</td>
           <td>
            <input type="text" name="coupon_dd[count]" value="{$coupon_dd.count}" placeholder="获得优惠券张数" size="20" class="inpMain" />
           </td>
          </tr>
          <tr>
           <td align="right">最小订单金额</td>
           <td>
            <input type="text" name="coupon_dd[min_price]" value="{$coupon_dd.min_price}" placeholder="最小订单金额" size="20" class="inpMain" />
           </td>
          </tr>
          <tr>
           <td align="right">结束时间</td>
           <td>
            <input type="text" name="coupon_dd[use_endtime]" value="{$coupon_dd.use_endtime}" placeholder="结束时间" size="20" class="inpMain" /> <b>天</b>
           </td>
          </tr>
        </table>
      </div>

      </div>

      <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
       <tr>
        <td width="131"></td>
        <td>
         <input type="hidden" name="token" value="{$token}" />
         <input name="submit" class="btn" type="submit" value="{$lang.btn_submit}" />
        </td>
       </tr>
      </table>
    </form>
    <!-- {/if} -->

   </div>
 </div>
 {include file="footer.htm"}
 </div>
</body>
</html>